package tedu.study.ooday03_2;

public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog("小黑",2,"黑");
        System.out.println(dog.name);
        dog = null;
        //System.out.println(dog.name);


        Dog[] dogs = new Dog[2];
        dogs[0] = new Dog("小黑",1,"黑");
        dogs[1] = new Dog("小灰",2,"灰");
        for(int i=0;i<dogs.length;i++){
            System.out.println(dogs[i].name);
            dogs[i].drink();
        }

        Chick[] chicks = new Chick[1];
        chicks[0] = new Chick("小花",1,"黄");
        for(int i=0;i<chicks.length;i++){
            System.out.println(chicks[i].age);
            chicks[i].eat();
        }

        Fish[] fish = new Fish[2];
        fish[0] = new Fish("小金",1,"金");
        fish[1] = new Fish("小银",1,"银");
        for(int i=0;i<fish.length;i++){
            System.out.println(fish[i].color);
            fish[i].swim();
        }

    }
}
